package net.uiiang.android.BiscuitBoxDemo.widget;

import net.uiiang.android.BiscuitBox.Exception.UncaughtExceptionHandler;
import net.uiiang.android.BiscuitBox.widget.GalleryTabactivity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;

public class GalleryTabActivityDemo extends GalleryTabactivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler(this,true));
        super.setTitileVisable(true);
        super.onCreate(savedInstanceState);
        setDelegate(new SliderBarActivityDelegateImpl());
        System.out.println("now = " + Build.VERSION.RELEASE);
        System.out.println("now = " + Build.VERSION.CODENAME);
        System.out.println("now = " + Build.VERSION.INCREMENTAL);
        System.out.println("now = " + Build.VERSION.SDK_INT);
        System.out.println("now = " + Build.VERSION.SDK);
        for (int i=0; i<14; i++)
        {
            Intent intent;
            if (i%2==0) intent = new Intent(this, DemoActivity1.class);
            else intent = new Intent(this, DemoActivity2.class);
            this.addTab("title"+i, android.R.drawable.star_on, intent);
            
        }
        super.commit();
    }

    private class SliderBarActivityDelegateImpl extends
            SliderBarActivityDelegate {
        /*
         * Optional callback method called when users tap on the tab bar button
         */
        protected void onTabChanged(int tabIndex) {
            Log.d("onTabChanged", "" + tabIndex);
        }
    }
}
